/**
 * @file happy.method.js
 * @synopsis 登录
 * @author leaytam
 * @version 1.0.0
 * @date 2016-11-30
 */
define(function(require, exports, module) {
    'use strict';

    var $ = require('jquery');
    
    var validate = {
        'email': function(value){
            return /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test( value );
        },
        'money': function(value){
        	return /^\d+(\.\d{1,2})?$/.test(value);
        },
        'digits': function(value){
        	return /^\d+$/.test( value );
        },
        'mobile': function(value){
        	return /1\d{10}/g.test(value);
        },
		'memberId':function(value){
			return /^\d{10}$/.test(value);
		},
		'captcha':function(value){
			return /^\d{6}$/.test(value);
		},
        'card': function(value){
            return /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(value);
        }
    }

    return validate;
});
